package com.mtsmda.designPattern1.creational.builder.example2;

import java.util.ArrayList;
import java.util.List;

public class CDType {

	private List<Packing> packings = new ArrayList<>();

	public void addItem(Packing packing) {
		this.packings.add(packing);
	}

	public int getAllCost() {
		int cost = 0;
		for (Packing packing : packings) {
			cost += packing.price();
		}
		return cost;
	}

	public void showItems() {
		for (Packing packing : packings) {
			System.out.println("Price - " + packing.price() + "\t Pack"
					+ packing.pack());
		}
	}

}